#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File    ：application.py
@Author  ：平
@Date    ：2025/9/28 11:25 
"""
from fastapi import FastAPI

from app.register import AuthRegister, CorsRegister, ExceptionRegister, RouterRegister


class Application:
    def __init__(self):
        self.app = FastAPI()
        self.registers = [  # 顺序很重要
            CorsRegister(),
            ExceptionRegister(),
            AuthRegister(),
            RouterRegister(),
        ]
        self.register()

    def register(self):
        for register in self.registers:
            register.register(self.app)


application = Application()
app = application.app
